<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="classes/CommonHelper.class.jsp" %>
<%@ include file="classes/DBHelper.class.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String message_id = request.getParameter("message_id");
    String sql = "select * from wlxj_consult t1 where 1=1 and message_id='" + message_id + "'";

    Map<String, Object> map = getObject(sql);
    pageContext.setAttribute("m", map);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>详细页</title>
        <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
        <link rel="stylesheet" href="css/tablecloth.css"  />
        <style type="text/css">
            td{
                padding: 3px;
            }
        </style>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#sure").click(function(){
                    var reply_content=$("#reply_content").val();
                    var status=$("#status").val();
                    var message_id=$("#message_id").val();
                    $.post("wlxj_gl_detail.class.jsp",
                    {
                        reply_content:reply_content,
                        message_id:message_id,
                        status:status
                    },
                    function(data,status){
                        if($.trim(status)=="success") {
                            alert("回复成功！");
                            window.location.href = "wlxj_gl_list.jsp?tt=" + new Date().getTime();
                        }
                    });
                });
            });
        </script>
    </head>
    <body >
        <a href="wlxj_gl_list.jsp?r=<%=new Date().getTime()%>">返回列表</a>
        <table>
            <tr>
                <th colspan="2" align="left"><span style="color: #990000;">写信人信息</span></th>
            </tr>
            <tr>
                <td><font color="red">*</font>写信人姓名：</td>
                <td>${m.messager_name}</td>
            </tr>
            <tr>
                <td><font color="red">*</font>写信人性别：</td>
                <td>
                    <c:if test="${m.status==1 }">男</c:if>
                    <c:if test="${m.status==0 }">女</c:if>
                </td>
            </tr>
            <tr>
                <td><font color="red">*</font>写信人电话：</td>
                <td>${m.messager_phone}</td>
            </tr>
            <tr>
                <td><font color="red">*</font>写信人电子邮件：</td>
                <td>${m.messager_email}</td>
            </tr>
            <tr>
                <td><font color="red">*</font>写信人地址：</td>
                <td>${m.messager_address}</td>
            </tr>
            <tr>
                <th colspan="2" align="left"><span style="color: #990000;">信件信息</span></th>
            </tr>
            <tr>
                <td><font color="red">*</font>标题：</td>
                <td> 
                    ${m.title}
                </td>
            </tr>
            <tr>
                <td>写信时间：</td><td colspan="3"> <fmt:formatDate value="${m.submit_time }" pattern="yyyy-MM-dd"/> </td>
            </tr>
            <tr>
                <td><font color="red">*</font>主要问题：</td><td>${m.content } </td>
            </tr>
            <tr>
                <th colspan="2" align="left"><span style="color: #990000;">办理信息</span></th>
            </tr>
            <tr>
                <td><font color="red">*</font>回复内容：</td>
                <td> 
                    <textarea id="reply_content" name="reply_content" style="width:100%;height: 120px">${m.reply_content }</textarea> 
                </td>
            </tr>
            <tr>
                <td><font color="red">*</font>办理状态：</td>
                <td> 
                    <select name="status" id="status">
                        <option value="1" <c:if test="${m.status=='1'}">selected</c:if>>未办理</option>
                        <option value="2" <c:if test="${m.status=='2'}">selected</c:if>>办理中</option>
                        <option value="3" <c:if test="${m.status=='3'}">selected</c:if>>已办理</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>写信时间：</td><td colspan="3"> <fmt:formatDate value="${m.reply_time }" pattern="yyyy-MM-dd"/> </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button"  value="提交" id="sure"/>
                    <input type="reset"   value="重置" />
                    <input type="hidden" id="message_id" value="<%=message_id%>"/>
                </td>
            </tr>
        </table>
    </body>
</html>